﻿/**********************************************************************
*创建人：蔡水明
*创建时间：2019/10/18 16:03:03
*说明：<全局静态参数和方法>
*模板文件：C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\ProjectTemplates\CSharp\Windows Root\Windows\2052\WindowsApplication
/**********************************************************************/
using System;
using System.Collections.Generic;
using System.IO;
using System.Windows.Forms;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EwmCreater
{
    /// <summary>
    /// 全局变量
    /// </summary>
    public static class GVar
    {
        /// <summary>
        /// 配置文件路径
        /// </summary>
        private static string _cfgPath = string.Empty;        
        public static string PngGirl = string.Empty;
        public static string PngStore = string.Empty;
        public static string PngUser = string.Empty;
        /// <summary>
        /// 初始化信息
        /// </summary>
        public static void IniVar()
        {
            _cfgPath = Path.Combine(Environment.CurrentDirectory, "Cfg");
            if (!Directory.Exists(_cfgPath)) Directory.CreateDirectory(_cfgPath);
            PngGirl = Path.Combine(_cfgPath, "Girl");
            if (!Directory.Exists(PngGirl)) Directory.CreateDirectory(PngGirl);
            PngStore = Path.Combine(_cfgPath, "Store");
            if (!Directory.Exists(PngStore)) Directory.CreateDirectory(PngStore);
            PngUser = Path.Combine(_cfgPath, "User");
            if (!Directory.Exists(PngUser)) Directory.CreateDirectory(PngUser);
        }
        #region 显示消息
        public static void ShowMessage(string content)
        {
            if (content != null)
                MessageBox.Show(content, "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
        public static DialogResult ShowYNCMessage(string content)
        {
            return MessageBox.Show(content, "提示", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Information);
        }
        #endregion
    }
}
